package com.atom.test.opengl.gesture

import android.view.MotionEvent
import androidx.annotation.IntDef

interface GestureListener {

    companion object{
        /**
         * The POSSIBLE gesture recognizer state. Gesture recognizers in this state are idle when there is no input event to
         * evaluate, or are evaluating input events to determine whether or not to transition into another state.
         */
        const val POSSIBLE = 0

        /**
         * The FAILED gesture recognizer state. Gesture recognizers transition to this state from the POSSIBLE state when
         * the gesture cannot be recognized given the current input.
         */
        const val FAILED = 1

        /**
         * The RECOGNIZED gesture recognizer state. Discrete gesture recognizers transition to this state from the POSSIBLE
         * state when the gesture is recognized.
         */
        const val RECOGNIZED = 2

        /**
         * The BEGAN gesture recognizer state. Continuous gesture recognizers transition to this state from the POSSIBLE
         * state when the gesture is first recognized.
         */
        const val BEGAN = 3

        /**
         * The CHANGED gesture recognizer state. Continuous gesture recognizers transition to this state from the BEGAN
         * state or the CHANGED state, whenever an input event indicates a change in the gesture.
         */
        const val CHANGED = 4

        /**
         * The CANCELLED gesture recognizer state. Continuous gesture recognizers may transition to this state from the
         * BEGAN state or the CHANGED state when the touch events are cancelled.
         */
        const val CANCELLED = 5

        /**
         * The ENDED gesture recognizer state. Continuous gesture recognizers transition to this state from either the BEGAN
         * state or the CHANGED state when the current input no longer represents the gesture.
         */
        const val ENDED = 6
    }

    @IntDef(POSSIBLE, FAILED, RECOGNIZED, BEGAN, CHANGED, CANCELLED, ENDED)
    @kotlin.annotation.Retention(AnnotationRetention.SOURCE)
    annotation class GestureState

    fun gestureStateChanged(event: MotionEvent, recognizer: GestureRecognizer)
}